package com.example.demo.mapper;

import com.example.demo.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date: 2024-01-25
 * Time: 9:39
 */
@Mapper
public interface ArticleInfoMapper {

    @Select("select * from articleinfo")
    List<ArticleInfo> selectAll();

    //多表联合查询
    @Select("select ta.*,tb.name,tb.age from articleinfo ta " +
            " left join test3 tb on ta.uid = tb.id" +
            " where tb.id=2")
    List<ArticleInfo> selectArticleAndUser();


}
